package cn.pupil.design.mediator;

/**
 * @Description: DefaultSqlSession工厂，创建获取DefaultSqlSession实例化对象
 * @Author: pupil
 * @Date: 2024/07/29 下午 6:21
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory{
    private final Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration.connection,configuration.mapperElement);
    }
}
